package com.greenant.store.bean;

import java.text.DecimalFormat;

import com.avos.avoscloud.AVACL;
import com.avos.avoscloud.AVClassName;

@AVClassName(AntAVObject.CLASS_INCOMEINFO)
public class IncomeInfo extends AntAVObject
{

    public static final String ATTR_userId = "userId"; // 申请提现账号id
    public static final String ATTR_accountBalance = "accountBalance"; // 账户余额
    public static final String ATTR_withdrawal = "withdrawal"; // 已提先金额
    public static final String ATTR_salesToday = "salesToday"; // 今日销售收入
    public static final String ATTR_salesCurMonth = "salesCurMonth";// 当月销售收入
    public static final String ATTR_salesAll = "salesAll"; // 累计销售收入
    public static final String ATTR_commissionToday = "commissionToday"; // 今日代售收入
    public static final String ATTR_commissionCurMonth = "commissionCurMonth";// 当月代售收入
    public static final String ATTR_commissionAll = "commissionAll";// 累计代售收入
    public static final String ATTR_EMRecvCountToday = "EMRecvCountToday";// 今日代收快递数量
    public static final String ATTR_EMRecvIncomeToday = "EMRecvIncomeToday";// 今日代收快递收入
    public static final String ATTR_EMRecvCountCurMonth = "EMRecvCountCurMonth";// 当月代收快递数量
    public static final String ATTR_EMRecvIncomeCurMonth = "EMRecvIncomeCurMonth";// 当月代收快递收入
    public static final String ATTR_EMRecvCountAll = "EMRecvCountAll";// 累计代收快递数量
    public static final String ATTR_EMRecvIncomeAll = "EMRecvIncomeAll";// 累计代收快递收入
    public static final String ATTR_EMSCountToday = "EMSCountToday";// 今日代发快递数
    public static final String ATTR_EMSIncomeToday = "EMSIncomeToday";// 今日代发快递收入
    public static final String ATTR_EMSCountCurMonth = "EMSCountCurMonth";// 当月代发快递数
    public static final String ATTR_EMSIncomeCurMonth = "EMSIncomeCurMonth";// 当月代发快递收入
    public static final String ATTR_EMSCountAll = "EMSCountAll";// 累计代发快递数
    public static final String ATTR_EMSIncomeAll = "EMSIncomeAll";// 累计代发快递收入
    
    public static final String ATTR_TransSales = "TransSales";// 交易中销售金额
    public static final String ATTR_TransSalesCount = "TransSalesCount";// 交易中订单数
    public static final String ATTR_TransCommission = "TransCommission";// 交易中代售金额
    public static final String ATTR_TransCommissionCount = "TransCommissionCount";// 交易中代售订单数
    public static final String ATTR_TransEMRecv = "TransEMRecv";// 交易中快递代收金额
    public static final String ATTR_TransEMRecvCount = "TransEMRecvCount";// 交易中快递代收单数
    public static final String ATTR_TransEMS = "TransEMS";//交易中快递代发金额
    public static final String ATTR_TransEMSCount = "TransEMSCount";//交易中快递代发单数

    DecimalFormat df = new DecimalFormat("#########.##");

    // return Double.parseDouble(df.format(price));
    public IncomeInfo()
    {
        super();
        setAccessCtrl();
    }

    public IncomeInfo(String str)
    {
        super(str);
        setAccessCtrl();
    }

    public IncomeInfo getInstance()
    {
        return this;
    }

    public String getUserId()
    {
        return this.getString(ATTR_userId);
    }

    public void setUserId(String userId)
    {
        this.put(ATTR_userId, userId);
    }

    public double getAccountBalance()
    {

        return Double.parseDouble(df.format(this.getDouble(ATTR_accountBalance)));
    }

    public void setAccountBalance(double userId)
    {
        this.put(ATTR_accountBalance, userId);
    }

    public double getWithdrawal()
    {

        return Double.parseDouble(df.format(this.getDouble(ATTR_withdrawal)));
    }

    public void setWithdrawal(double userId)
    {
        this.put(ATTR_withdrawal, userId);
    }

    public double getSalesToday()
    {

        return Double.parseDouble(df.format(this.getDouble(ATTR_salesToday)));
    }

    public void setSalesToday(double userId)
    {
        this.put(ATTR_salesToday, userId);
    }

    public double getSalesCurMonth()
    {

        return Double.parseDouble(df.format(this.getDouble(ATTR_salesCurMonth)));
    }

    public void setSalesCurMonth(double userId)
    {
        this.put(ATTR_salesCurMonth, userId);
    }

    public double getSalesAll()
    {

        return Double.parseDouble(df.format(this.getDouble(ATTR_salesAll)));
    }

    public void setSalesAll(double userId)
    {
        this.put(ATTR_salesAll, userId);
    }

    public double getCommissionToday()
    {

        return Double.parseDouble(df.format(this.getDouble(ATTR_commissionToday)));
    }

    public void setCommissionToday(double userId)
    {
        this.put(ATTR_commissionToday, userId);
    }

    public double getCommissionCurMonth()
    {

        return Double.parseDouble(df.format(this.getDouble(ATTR_commissionCurMonth)));
    }

    public void setCommissionCurMonth(double userId)
    {
        this.put(ATTR_commissionCurMonth, userId);
    }

    public double getCommissionAll()
    {

        return Double.parseDouble(df.format(this.getDouble(ATTR_commissionAll)));
    }

    public void setCommissionAll(double userId)
    {
        this.put(ATTR_commissionAll, userId);
    }

    public double getEMRecvCountToday()
    {

        return Double.parseDouble(df.format(this.getDouble(ATTR_EMRecvCountToday)));
    }

    public void setEMRecvCountToday(double userId)
    {
        this.put(ATTR_EMRecvCountToday, userId);
    }

    public double getEMRecvIncomeToday()
    {

        return Double.parseDouble(df.format(this.getDouble(ATTR_EMRecvIncomeToday)));
    }

    public void setEMRecvIncomeToday(double userId)
    {
        this.put(ATTR_EMRecvIncomeToday, userId);
    }

    public double getEMRecvCountCurMonth()
    {

        return Double.parseDouble(df.format(this.getDouble(ATTR_EMRecvCountCurMonth)));
    }

    public void setEMRecvCountCurMonth(double userId)
    {
        this.put(ATTR_EMRecvCountCurMonth, userId);
    }

    public double getEMRecvIncomeCurMonth()
    {

        return Double.parseDouble(df.format(this.getDouble(ATTR_EMRecvIncomeCurMonth)));
    }

    public void setEMRecvIncomeCurMonth(double userId)
    {
        this.put(ATTR_EMRecvIncomeCurMonth, userId);
    }

    public double getEMRecvCountAll()
    {

        return Double.parseDouble(df.format(this.getDouble(ATTR_EMRecvCountAll)));
    }

    public void setEMRecvCountAll(double userId)
    {
        this.put(ATTR_EMRecvCountAll, userId);
    }

    public double getEMRecvIncomeAll()
    {

        return Double.parseDouble(df.format(this.getDouble(ATTR_EMRecvIncomeAll)));
    }

    public void setEMRecvIncomeAll(double userId)
    {
        this.put(ATTR_EMRecvIncomeAll, userId);
    }

    public double getEMSCountToday()
    {

        return Double.parseDouble(df.format(this.getDouble(ATTR_EMSCountToday)));
    }

    public void setEMSCountToday(double userId)
    {
        this.put(ATTR_EMSCountToday, userId);
    }

    public double getEMSIncomeToday()
    {

        return Double.parseDouble(df.format(this.getDouble(ATTR_EMSIncomeToday)));
    }

    public void setEMSIncomeToday(double userId)
    {
        this.put(ATTR_EMSIncomeToday, userId);
    }

    public double getEMSCountCurMonth()
    {

        return Double.parseDouble(df.format(this.getDouble(ATTR_EMSCountCurMonth)));
    }

    public void setEMSCountCurMonth(double userId)
    {
        this.put(ATTR_EMSCountCurMonth, userId);
    }

    public double getEMSIncomeCurMonth()
    {

        return Double.parseDouble(df.format(this.getDouble(ATTR_EMSIncomeCurMonth)));
    }

    public void setEMSIncomeCurMonth(double userId)
    {
        this.put(ATTR_EMSIncomeCurMonth, userId);
    }

    public double getEMSCountAll()
    {

        return Double.parseDouble(df.format(this.getDouble(ATTR_EMSCountAll)));
    }

    public void setEMSCountAll(double userId)
    {
        this.put(ATTR_EMSCountAll, userId);
    }

    public double getEMSIncomeAll()
    {

        return Double.parseDouble(df.format(this.getDouble(ATTR_EMSIncomeAll)));
    }

    public void setEMSIncomeAll(double userId)
    {
        this.put(ATTR_EMSIncomeAll, userId);
    }
    
    public double getTransSales()
    {

        return Double.parseDouble(df.format(this.getDouble(ATTR_TransSales)));
    }

    public void setTransSales(double userId)
    {
        this.put(ATTR_TransSales, userId);
    }
    
    public double getTransSalesCount()
    {

        return Double.parseDouble(df.format(this.getDouble(ATTR_TransSalesCount)));
    }

    public void setTransSalesCount(double userId)
    {
        this.put(ATTR_TransSalesCount, userId);
    }
    
    public double getTransCommission()
    {

        return Double.parseDouble(df.format(this.getDouble(ATTR_TransCommission)));
    }

    public void setTransCommission(double userId)
    {
        this.put(ATTR_TransCommission, userId);
    }
    
    public double getTransCommissionCount()
    {

        return Double.parseDouble(df.format(this.getDouble(ATTR_TransCommissionCount)));
    }

    public void setTransCommissionCount(double userId)
    {
        this.put(ATTR_TransCommissionCount, userId);
    }
    
    public double getTransEMRecv()
    {

        return Double.parseDouble(df.format(this.getDouble(ATTR_TransEMRecv)));
    }

    public void setTransEMRecv(double userId)
    {
        this.put(ATTR_TransEMRecv, userId);
    }
    
    public double getTransEMRecvCount()
    {

        return Double.parseDouble(df.format(this.getDouble(ATTR_TransEMRecvCount)));
    }

    public void setTransEMRecvCount(double userId)
    {
        this.put(ATTR_TransEMRecvCount, userId);
    }
    
    public double getTransEMS()
    {

        return Double.parseDouble(df.format(this.getDouble(ATTR_TransEMS)));
    }

    public void setTransEMS(double userId)
    {
        this.put(ATTR_TransEMS, userId);
    }
    
    public double getTransEMSCount()
    {

        return Double.parseDouble(df.format(this.getDouble(ATTR_TransEMSCount)));
    }

    public void setTransEMSCount(double userId)
    {
        this.put(ATTR_TransEMSCount, userId);
    }
    
    private int setAccessCtrl()
    {

        acl = new AVACL();
        acl.setPublicReadAccess(true);// �˴����õ��������˵Ŀɶ�Ȩ��
        acl.setPublicWriteAccess(true);
        this.setACL(acl);

        return 0;
    }

}
